package com.woniuxy.lifeorder.api.feign.fallback;

import com.woniuxy.life.core.api.CommonResult;
import com.woniuxy.lifeorder.api.dto.BusOrder;
import com.woniuxy.lifeorder.api.feign.OrderService;
import com.woniuxy.lifeorder.api.vo.OrderInsertVO;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@Setter
public class OrderServiceFallbackImpl  implements OrderService {
    private Throwable cause;

    @Override
    public CommonResult pageOrder(Integer current, Integer size, BusOrder busOrder) {
        log.error("订单查询错误",cause);
        return CommonResult.failed(501L,"订单查询错误");
    }

    @Override
    public CommonResult updateOrder(BusOrder busOrder) {
        log.error("订单更新错误",cause);
        return CommonResult.failed(502L,"订单更新错误");
    }

    @Override
    public CommonResult insertOrder(OrderInsertVO insertVO) {
        log.error("订单生成错误",cause);
        return CommonResult.failed(503L,"订单生成错误");
    }

    @Override
    public CommonResult deleteOrder(Integer orderId) {
        log.error("订单删除失败",cause);
        return CommonResult.failed(504L,"订单删除失败");
    }
}
